home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / vlapak1.zip / VLA_FONT.ZIP / MCLSUB.INC < prev    next >
Text File  |  1993-08-05  |  2KB  |  64 lines

  1. ;FILE: MCLSUB.ASM
  2. ;upon entry: 
  3. ;
  4. ;*      ES= PSP SEG 
  5. ;*      DS:DX = pointer to filename area
  6. ;*      DS:BX = pointer to ASCIIZ Extension to add
  7. ;*      BP    = 1, override extension. =0 extension only if there is none
  8. ;
  9. ;RETURN:    AX= length of command line
  10. ;
  11. ;       Removes anything < a space...
  12. ────────────────────────────────────────────────────────────────────────────
  13. MCL_L   dw  ?
  14. ────────────────────────────────────────────────────────────────────────────
  15. PROC GetCommandLine
  16.     pusha
  17.     
  18.     mov     si,128      ;es:si points to command line
  19.     movzx   ax,[BYTE es:si]
  20.     mov     [cs:MCL_L],ax
  21.     or      ax,ax
  22.     je      @@AllDone
  23.     inc     si          ;point to 1st byte of command line
  24.     mov     cx,ax
  25.     
  26.     mov     di,dx       ;ds:di points to filename area
  27.     xor     dl,dl       ;flag for "." hit
  28. @@CopyLoop:
  29.     mov     al,[es:si]
  30.     inc     si
  31.     cmp     al," "
  32.     jbe     @@DontStore
  33.     cmp     al,"."
  34.     je      @@HandleDot
  35. @@NoOverRide:
  36.     mov     [di],al
  37.     inc     di
  38. @@DontStore:
  39.     loop    @@CopyLoop
  40.     or      dl,dl           ;did we hit a dot?
  41.     je      short @@Copy2Loop   ;nope, tack one on..
  42.     jmp     short @@AllDone1
  43.  
  44. @@HandleDot:
  45.     inc     dl          ;save hit "."
  46.     cmp     bp,1
  47.     jne     @@NoOverRide
  48.     
  49. @@Copy2Loop:
  50.     mov     al,[bx]
  51.     inc     bx
  52.     or      al,al
  53.     je      @@AllDone1
  54.     mov     [di],al
  55.     inc     di
  56.     jmp     short @@Copy2Loop
  57. @@AllDone1:
  58.     mov     [BYTE di],0     ;tack on the zero...
  59. @@AllDone:
  60.     popa
  61.     mov     ax,[cs:MCL_L]
  62.     ret
  63. ENDP
  64.